<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动态添加 DOM 节点内容</title>
</head>
<body>
<button id="btn">添加</button>

<script>
    let btn = document.getElementById("btn");

    btn.onclick = function () {
        let element = document.createElement("input");
        document.body.appendChild(element)
        element.focus()
    }
</script>
</body>
</html>